package com.dd.consul_consumer_feign.service;

import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Component;
import com.dd.consul_consumer_feign.dto.UserDto;

@Component
public class UserServiceFallback implements UserService{

	public String hello() {
		return "invoke hello error!";
	}

	public List<UserDto> list() {
		return new ArrayList<UserDto>(0);
	}

	public UserDto getUser(Long id) {
		return new UserDto(-1L,"为知","为知");
	}

	public boolean add(UserDto user) {
		throw new RuntimeException("invoke add error");
	}

	public boolean update(UserDto user) {
		throw new RuntimeException("invoke update error");
	}

	public boolean delete(Long id) {
		throw new RuntimeException("invoke delete error");
	}

	public UserDto getUserTimeOut(Long id) {
		System.out.println("=====服务降级========");
		throw new RuntimeException("invoke getUserTimeOut error");
	}

}
